package com.bafa.front.presentationbeans;

import java.util.TreeSet;

import com.bafa.objects.Match;
import com.bafa.services.RetrieveServices;

public class ResultsListBean {

	private TreeSet matches = new TreeSet();

	public TreeSet getMatches() {
		return matches;
	}

	public void setMatches(TreeSet matches) {
		this.matches = matches;
	}
	
	
	public ResultsListBean(Integer[] matches){
		for(int i=0;i<matches.length;i++){
			Match match = RetrieveServices.getMatch(matches[i]);
			if(match.isPlayed())
				this.matches.add(new MatchBean(match));
		}
	}
	
	public MatchBean[] matches(){
		return (MatchBean[])matches.toArray(new MatchBean[matches.size()]);
	}
	
	
}
